﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace sy1_7
{
    public partial class Form1 : Form
    {
        private int maxWidth = 240;
        private int maxHeight = 180;
        private int minWidth = 24;
        private int minHeight = 18;
        private int stepWidth = 24;
        private int stepHeight = 18;
        public Form1()
        {
            InitializeComponent();
        }

        private void pictureBox1_Click(object sender, EventArgs e)
        {

        }

        private void Form1_Load(object sender, EventArgs e)
        {
            pictureBox1.Width = maxWidth;
            pictureBox1.Height = maxHeight;
            button1.Enabled = false;
        }

        private void button2_Click(object sender, EventArgs e)
        {
            pictureBox1.Width -= stepWidth;
            pictureBox1.Height -= stepHeight;
            button1.Enabled = true;
            if (pictureBox1.Width <= minWidth && pictureBox1.Height <= minHeight)
            {
                button2.Enabled = false;
            }
        }

        private void button1_Click(object sender, EventArgs e)
        {
            pictureBox1.Width += stepWidth;
            pictureBox1.Height += stepHeight;
            button2.Enabled = true;
            if (pictureBox1.Width >= maxWidth && pictureBox1.Height >= maxHeight)
            {
                button1.Enabled = false;
            }
        }
    }
}
